package org.azmat.demoredis.RedisTemplate.RedisSQL;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class BookService {
    @Autowired
    private BookDao bookDao;

    public String getValue(String key) {
        return bookDao.get(key);
    }

    public void setValue(String key, String value) {
        bookDao.setValue(key, value);
    }

    public List<Book> findAll(String id) {
        return bookDao.findAll(id);
    }

    public void save(Object key, List<Book> book) {
        bookDao.savaBooks(key, book);
    }

    public Book findById(String id) {
        return bookDao.findById(id);
    }

    public void deleteById(int id) {
        bookDao.deleteBook(id);
    }

    public void savaBook(Book book) {
        bookDao.savaBook(book);
    }

}
